home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Sample Code / Snippets / Interapplication Communication / AECDEV⁄AEDAEMON / NonAppAEVT.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-15  |  4.4 KB  |  146 lines  |  [TEXT/MPS ]

  1. /* If you are not pre-compiling your C header files in MPW, you really */
  2. /* owe it to yourself to do so.  It can save (for most apps ) */
  3. /* a good 30% of your compile time */
  4. /* Lookin your MPW C manual for details, or follow these steps */
  5.  
  6.  
  7.  /* The first time you compile your program, set the flag after this IF */
  8.  /* to TRUE */
  9.  /* This will tell MPW C to dump the headers for you.  Then change the flag */
  10.  /* to FALSE, and MPW will read the dumped file from then on, saving you much time */
  11.  /* NOTE: Remember, if the headers change, recompile */
  12. /* #if 0 */
  13. #include <Types.h>
  14. #include <Memory.h>
  15. #include <Quickdraw.h>
  16. #include <TextEdit.h>
  17. #include <Dialogs.h>
  18. #include <Devices.h>
  19. #include <Scrap.h>
  20. #include <menus.h> 
  21. #include <PPCToolbox.h>
  22. #include <AppleEvents.h>
  23. #include <StandardFile.h>
  24. #include <EPPC.h>
  25. #include <Aliases.h>
  26. #include <events.h>
  27. #include <gestaltequ.h>
  28. #include <ToolUtils.h>
  29. /* Name this anythign you want.  I personally precompile ALL the header files */
  30. /* and save tehm in a file in the CIncludes directory.  But, that file ends up */
  31. /* being about 1.5 meg, and you may want something smaller */
  32. /* #pragma dump "NonAppDump" */
  33.  
  34. /* #else */
  35. /* #pragma load "NonAppDump" */
  36. /* #endif */
  37.  
  38.  
  39.  
  40.  
  41.  
  42. /* Types */
  43. struct MyPPCRec {
  44. PPCParamBlockRec    pB;
  45. Ptr        buffer;        /* buffer we're using */
  46. Size bufferSize;    /* guess */
  47. Handle dataToXfer;
  48. PPCPortPtr myPort;
  49. PPCPortPtr buddyPortPtr;
  50. PPCPortRefNum ourPort;
  51. PPCSessRefNum currentSessionRef;
  52.  
  53. };
  54. typedef struct MyPPCRec MyPPCRec, *MyPPCRecPtr,**MyPPCRecHandle;
  55.  
  56.  
  57. typedef struct CDEVRec {
  58. Handle spare;
  59. MyPPCRecPtr myPPCBlock;
  60. /* LocationName won't be needed, since we're staying local */
  61. Boolean searchForTarget;  /* searchForTarget is our flag to tell us that we do not */
  62.                         /* know where AEBuddy is yet, and we have to keep looking. */
  63.                         /*  It also implies (if true) that PBCat has already been */
  64.                         /* called, if necessary */
  65. Boolean noBuddy;        /* PBCatSearch failed, give it up */
  66. Boolean notSys7;
  67. Boolean eventPending;
  68. } CDEVRec, *CDEVPtr, **CDEVHnd;
  69.  
  70.  
  71.  
  72.  
  73. struct MyPPCRecDeamon { /* to differenciact it from the one I'm using in teh CDEV */
  74. PPCParamBlockRec    pB;
  75. Ptr        buffer;        /* buffer we're using */
  76. Size bufferSize;    /* guess */
  77. Handle dataToXfer;
  78. PPCPortPtr myPort;
  79. PPCPortRefNum ourPort;
  80. PPCSessRefNum currentSessionRef;
  81.  
  82. };
  83. typedef struct MyPPCRecDeamon MyPPCRecDeamon, *MyPPCRecPtrDeamon,**MyPPCRecHandleDeamon;
  84. #define kOneK 1024
  85. #define kMyTypeOfData 'MAVT'
  86. #define kGenericCreator '????'
  87. #define kSendButton 1
  88. #define kNoBuddyAlert -4048
  89. #define kNot70 -4049
  90. #define kStringsID -4048
  91. #define kBrowse1 1
  92. #define kBrowse2 2
  93. #define kMyName 3
  94. #define kWatchCursor 4
  95.  
  96. /* Prototypes and externs (there the same, y'see ) */
  97.  
  98. #ifdef __BUILDINGDEAMON__
  99. #ifdef __DAE__
  100. #define sayExtern                
  101. #else
  102. #define sayExtern extern
  103. #endif
  104. sayExtern void InitAEStuff(void);
  105. sayExtern void DoHighLevel(EventRecord *AERecord);
  106. sayExtern pascal OSErr AEOpenHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
  107. sayExtern pascal OSErr AEOpenDocHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
  108. sayExtern pascal OSErr AEPrintHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
  109. sayExtern pascal OSErr AEQuitHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
  110. #ifdef __AEDPPCSTUFF__
  111. #define sayExtern                
  112. #else
  113. #define sayExtern extern
  114. #endif
  115. sayExtern Boolean InformTheWorld(void);
  116. sayExtern OSErr OpenAPort(PPCOpenPBPtr myPort);
  117. sayExtern Boolean DoInform(PPCInformPBPtr p);
  118. sayExtern void CloseOffTheWorld(void);
  119. sayExtern void OpenComplete(PPCInformPBPtr p);
  120. sayExtern void InformComplete(PPCReadPBPtr p);
  121. sayExtern void ReadComplete(PPCReadPBPtr p);
  122. sayExtern void CollectLastData(void);
  123. #endif
  124.  
  125. #ifdef __BUILDINGCDEV__
  126. #ifdef __AEDEV__
  127. #define sayExtern                
  128. #else
  129. #define sayExtern extern
  130. #endif
  131. sayExtern pascal Handle AECDEV(short message, short item, short numItems, short CPanelID, EventRecord *theEvent, Handle cdevStorage,
  132.                      DialogPtr CPDialog);
  133. sayExtern ControlHandle SnatchHandle(DialogPtr thebox, short theGetItem);
  134. #ifdef __AECDEVPPC__
  135. #define sayExtern                
  136. #else
  137. #define sayExtern extern
  138. #endif
  139. sayExtern void FindATarget(CDEVHnd storage);
  140. sayExtern void FindAEBuddy(CDEVHnd storage);
  141. sayExtern void FireTheEvent(Handle packedEvent, CDEVHnd storage);
  142. sayExtern void OpenComplete(PPCStartPBPtr p);
  143. sayExtern void StartComplete(PPCWritePBPtr p);
  144. sayExtern void WriteComplete(PPCEndPBPtr p);
  145. sayExtern void EndComplete(PPCClosePBPtr p);
  146. #endif